<!DOCTYPE HTML>
<html lang="zh-hans" >
    <!-- Start book Linux -->
<!-- Start book Linux -->
    <head>
        <!-- head:start -->
<!-- head:start -->
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <title>压缩解压命令 | Linux</title>
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <meta name="description" content="">
        <meta name="generator" content="GitBook 2.6.7">
        <meta name="author" content="chris Jiang">
        
        <meta name="HandheldFriendly" content="true"/>
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <link rel="apple-touch-icon-precomposed" sizes="152x152" href="gitbook/images/apple-touch-icon-precomposed-152.png">
        <link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon">
        
    <link rel="stylesheet" href="gitbook/style.css">
    
        
        <link rel="stylesheet" href="gitbook/plugins/gitbook-plugin-prism/prism.css">
        
    
        
        <link rel="stylesheet" href="gitbook/plugins/gitbook-plugin-splitter/splitter.css">
        
    
        
        <link rel="stylesheet" href="gitbook/plugins/gitbook-plugin-toggle-chapters/toggle.css">
        
    
        
        <link rel="stylesheet" href="gitbook/plugins/gitbook-plugin-highlight/website.css">
        
    
        
        <link rel="stylesheet" href="gitbook/plugins/gitbook-plugin-fontsettings/website.css">
        
    
    

        
    
    
    <link rel="next" href="./chapter11.html" />
    
    
    <link rel="prev" href="./chapter09.html" />
    

        <!-- head:end -->
<!-- head:end -->
    </head>
    <body>
        <!-- body:start -->
<!-- body:start -->
        
    <div class="book"
        data-level="10"
        data-chapter-title="压缩解压命令"
        data-filepath="chapter10.md"
        data-basepath="."
        data-revision="Mon Sep 30 2019 00:13:13 GMT+0800 (CST)"
        data-innerlanguage="">
    

<div class="book-summary">
    <nav role="navigation">
        <ul class="summary">
            
            
            
            

            

            
    
        <li class="chapter " data-level="0" data-path="index.html">
            
                
                    <a href="./index.html">
                
                        <i class="fa fa-check"></i>
                        
                        学习目标
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1" data-path="chapter01.html">
            
                
                    <a href="./chapter01.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.</b>
                        
                        Linux入门
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1" data-path="01/section01.html">
            
                
                    <a href="./01/section01.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.1.</b>
                        
                        操作系统介绍
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="01/section02.html">
            
                
                    <a href="./01/section02.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.2.</b>
                        
                        Linux系统介绍
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="01/section03.html">
            
                
                    <a href="./01/section03.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.3.</b>
                        
                        使用虚拟机安装Ubuntu
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="01/section04.html">
            
                
                    <a href="./01/section04.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.4.</b>
                        
                        使用U盘安装双系统
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="01/section05.html">
            
                
                    <a href="./01/section05.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.5.</b>
                        
                        配置Linux系统
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="01/section06.html">
            
                
                    <a href="./01/section06.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.6.</b>
                        
                        Linux启动流程
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="01/section07.html">
            
                
                    <a href="./01/section07.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.7.</b>
                        
                        远程连接Linux
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2" data-path="chapter02.html">
            
                
                    <a href="./chapter02.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.</b>
                        
                        软件安装相关指令
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3" data-path="chapter03.html">
            
                
                    <a href="./chapter03.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.</b>
                        
                        文件系统
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4" data-path="chapter04.html">
            
                
                    <a href="./chapter04.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.</b>
                        
                        vim编辑器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5" data-path="chapter05.html">
            
                
                    <a href="./chapter05.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.</b>
                        
                        目录操作的常见指令
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6" data-path="chapter06.html">
            
                
                    <a href="./chapter06.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.</b>
                        
                        python、pip和ipython的安装
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7" data-path="chapter07.html">
            
                
                    <a href="./chapter07.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.</b>
                        
                        虚拟环境管理
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="8" data-path="chapter08.html">
            
                
                    <a href="./chapter08.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>8.</b>
                        
                        用户管理相关指令
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="9" data-path="chapter09.html">
            
                
                    <a href="./chapter09.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>9.</b>
                        
                        权限管理
                    </a>
            
            
        </li>
    
        <li class="chapter active" data-level="10" data-path="chapter10.html">
            
                
                    <a href="./chapter10.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>10.</b>
                        
                        压缩解压命令
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="11" data-path="chapter11.html">
            
                
                    <a href="./chapter11.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>11.</b>
                        
                        服务监听
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="12" data-path="chapter12.html">
            
                
                    <a href="./chapter12.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>12.</b>
                        
                        管道和重定向
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="13" data-path="chapter13.html">
            
                
                    <a href="./chapter13.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>13.</b>
                        
                        Nginx的安装和配置
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="14" data-path="chapter14.html">
            
                
                    <a href="./chapter14.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>14.</b>
                        
                        Git的使用
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="14.1" data-path="14/section01.html">
            
                
                    <a href="./14/section01.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>14.1.</b>
                        
                        git本地和远端管理
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="14.2" data-path="14/section02.html">
            
                
                    <a href="./14/section02.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>14.2.</b>
                        
                        冲突的介绍
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="14.3" data-path="14/section03.html">
            
                
                    <a href="./14/section03.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>14.3.</b>
                        
                        分支操作
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="14.4" data-path="14/section04.html">
            
                
                    <a href="./14/section04.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>14.4.</b>
                        
                        远端服务器的SSH连接
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="15" data-path="chapter15.html">
            
                
                    <a href="./chapter15.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>15.</b>
                        
                        shell编程
                    </a>
            
            
        </li>
    


            
            <li class="divider"></li>
            <li>
                <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
                    本书使用 GitBook 发布
                </a>
            </li>
            
        </ul>
    </nav>
</div>

    <div class="book-body">
        <div class="body-inner">
            <div class="book-header" role="navigation">
    <!-- Actions Left -->
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="./" >Linux</a>
    </h1>
</div>

            <div class="page-wrapper" tabindex="-1" role="main">
                <div class="page-inner">
                
                
                    <section class="normal" id="section-">
                    
                        <h1 id="&#x538B;&#x7F29;&#x89E3;&#x538B;&#x547D;&#x4EE4;">&#x538B;&#x7F29;&#x89E3;&#x538B;&#x547D;&#x4EE4;</h1>
<ul>
<li><p>zip/unzip&#xFF0C;&#x6587;&#x4EF6;&#x540E;&#x7F00;&#x540D;&#x4E3A;zip</p>
<pre><code class="lang-shell">&#x538B;&#x7F29;: 
    zip 123.zip *.txt   # &#x5C06;&#x6240;&#x6709;&#x7684;txt&#x6587;&#x4EF6;&#x538B;&#x7F29;&#x6210;123.zip&#x6587;&#x4EF6;
    zip -r test.zip test # &#x5C06;test&#x6587;&#x4EF6;&#x5939;&#x6253;&#x5305;&#x6210;test.zip
&#x89E3;&#x538B;: unzip 123.zip
</code></pre>
</li>
<li><p>gzip/gunzip&#xFF0C;&#x6587;&#x4EF6;&#x540E;&#x7F00;&#x540D;&#x4E3A;gz</p>
<pre><code class="lang-bash">&#x538B;&#x7F29;&#xFF1A;  
    gzip <span class="hljs-number">1</span>.txt   <span class="hljs-comment"># &#x5C06;1.txt&#x538B;&#x7F29;&#x6210;1.txt.gz</span>
    gzip -r <span class="hljs-built_in">test</span> <span class="hljs-comment"># &#x5C06;test&#x6587;&#x4EF6;&#x5939;&#x91CC;&#x7684;&#x6BCF;&#x4E00;&#x4E2A;&#x6587;&#x4EF6;&#x90FD;&#x6253;&#x5305;&#x6210; .gz&#x6587;&#x4EF6;</span>
&#x89E3;&#x538B;: 
    gunzip <span class="hljs-number">1</span>.txt.gz
    gzip <span class="hljs-operator">-d</span> <span class="hljs-number">1</span>.txt.gz
</code></pre>
</li>
<li><p>bzip2/bunzip2&#xFF0C;&#x6587;&#x4EF6;&#x540E;&#x7F00;&#x540D;&#x662F;bz2.</p>
<pre><code class="lang-bash">&#x538B;&#x7F29;&#xFF1A;  bzip2 <span class="hljs-number">1</span>.txt <span class="hljs-comment"># &#x5C06;1.txt&#x538B;&#x7F29;&#x6210;1.txt.bz2</span>
&#x89E3;&#x538B;&#xFF1A;
    bunzip2 <span class="hljs-number">1</span>.txt.bz2
    bzip2 <span class="hljs-operator">-d</span> <span class="hljs-number">1</span>.txt.bz2
    bzip2 -dk <span class="hljs-number">1</span>.txt.bz2 <span class="hljs-comment"># &#x89E3;&#x538B;1.txt.bz2&#x6587;&#x4EF6;&#xFF0C;&#x5E76;&#x4E14;&#x4FDD;&#x7559;1.txt.bz2&#x8FD9;&#x4E2A;&#x6587;&#x4EF6;</span>
</code></pre>
<p>&#x6CE8;&#x610F;&#xFF1A; <strong>&#x65E0;&#x8BBA;&#x662F;gzip&#xFF0C;&#x8FD8;&#x662F;bzip2&#xFF0C;&#x90FD;&#x65E0;&#x6CD5;&#x5F88;&#x65B9;&#x4FBF;&#x7684;&#x538B;&#x7F29;&#x548C;&#x89E3;&#x538B;&#x6587;&#x4EF6;&#x5939;&#x3002;</strong></p>
</li>
<li><p>tar&#xFF0C;&#x6253;&#x5305;&#x89E3;&#x5305;&#x5DE5;&#x5177;&#xFF0C;&#x540E;&#x7F00;&#x540D;&#x662F;tar.</p>
<pre><code class="lang-bash">&#x9009;&#x9879;:
    -c&#xFF1A;&#x521B;&#x5EFA;&#x65B0;&#x7684;&#x6253;&#x5305;&#x6587;&#x4EF6;
    -x: &#x89E3;&#x5305;&#x3002;
    -t: &#x4E0D;&#x89E3;&#x5305;&#x67E5;&#x770B;&#x6587;&#x4EF6;&#x3002;
    &#x6CE8;&#x610F;&#xFF1A;&#x4EE5;&#x4E0A;&#x4E09;&#x4E2A;&#x9009;&#x9879;&#x4E0D;&#x80FD;&#x540C;&#x65F6;&#x4F7F;&#x7528;&#xFF0C;&#x56E0;&#x4E3A;&#x529F;&#x80FD;&#x51B2;&#x7A81;&#x3002;
    -v: &#x663E;&#x793A;&#x8BE6;&#x7EC6;&#x4FE1;&#x606F;&#x3002;
    <span class="hljs-operator">-f</span>: &#x6307;&#x5B9A;&#x64CD;&#x4F5C;&#x6587;&#x4EF6;&#x3002;
    -z: &#x8C03;&#x7528;gzip/gunzip&#x8FDB;&#x884C;&#x538B;&#x7F29;&#x89E3;&#x538B;&#x64CD;&#x4F5C;&#xFF0C;&#x540E;&#x7F00;&#x540D;&#x662F;.tar.gz
    -j: &#x8C03;&#x7528;bzip2/bunzip2&#x8FDB;&#x884C;&#x538B;&#x7F29;&#x89E3;&#x538B;&#x64CD;&#x4F5C;&#xFF0C;&#x540E;&#x7F00;&#x540D;&#x662F;.tar.bz2
&#x793A;&#x4F8B;&#xFF1A;
    tar -cvf test.tar <span class="hljs-built_in">test</span> <span class="hljs-comment"># &#x5C06;test&#x6587;&#x4EF6;&#x5939;&#x6253;&#x5305;&#x6210;test.jar&#x6587;&#x4EF6;,&#x5E76;&#x663E;&#x793A;&#x6253;&#x5305;&#x4FE1;&#x606F;</span>
    tar -cvf <span class="hljs-number">123</span>.tar <span class="hljs-number">1</span>.txt <span class="hljs-number">2</span>.txt <span class="hljs-number">3</span>.txt <span class="hljs-comment"># &#x5C06;1.txt,2.txt&#x548C;3.txt&#x6587;&#x4EF6;&#x6253;&#x5305;&#x5230;123.tar&#x6587;&#x4EF6;</span>
    tar -tf <span class="hljs-number">123</span>.tar   <span class="hljs-comment"># &#x4E0D;&#x89E3;&#x5305;&#x67E5;&#x770B;123.tar&#x6587;&#x4EF6;&#x91CC;&#x7684;&#x5185;&#x5BB9;</span>
    tar -xvf <span class="hljs-number">123</span>.tar  <span class="hljs-comment"># &#x89E3;&#x5305;123.tar&#x6587;&#x4EF6;&#xFF0C;&#x5E76;&#x663E;&#x793A;&#x8BE6;&#x7EC6;&#x4FE1;&#x606F;</span>

    tar -zcvf <span class="hljs-number">12</span>.tar.gz <span class="hljs-number">1</span>.txt <span class="hljs-number">2</span>.txt <span class="hljs-comment"># &#x5C06;1.txt&#x548C;2.txt&#x538B;&#x7F29;&#x5E76;&#x6253;&#x5305;&#x6210;12.tar.gz&#x6587;&#x4EF6;</span>
    tar -jcvf <span class="hljs-number">12</span>.tar.bz2 <span class="hljs-number">1</span>.txt <span class="hljs-number">2</span>.txt <span class="hljs-comment"># &#x5C06;1.txt&#x548C;2.txt&#x538B;&#x7F29;&#x5E76;&#x6253;&#x5305;&#x6210;12.tar.bz2&#x6587;&#x4EF6;</span>

    tar -zxvf <span class="hljs-number">12</span>.tar.gz   <span class="hljs-comment"># &#x89E3;&#x538B;&#x5E76;&#x89E3;&#x5305;12.tar.gz&#x6587;&#x4EF6;</span>
    tar -jxvf <span class="hljs-number">12</span>.tar.bz2  <span class="hljs-comment"># &#x89E3;&#x538B;&#x5E76;&#x89E3;&#x5305;12.tar.bz2&#x6587;&#x4EF6;&#x3002;</span>
</code></pre>
<p>&#x6CE8;&#x610F;&#xFF1A;tar &#x53EA;&#x662F;&#x7528;&#x6765;&#x6253;&#x5305;&#x548C;&#x89E3;&#x5305;&#x7684;&#x5DE5;&#x5177;&#xFF0C;&#x5B83;&#x672C;&#x8EAB;&#x662F;&#x6CA1;&#x6709;&#x538B;&#x7F29;&#x548C;&#x89E3;&#x538B;&#x7F29;&#x7684;&#x529F;&#x80FD;&#x3002;&#x4F46;&#x662F;&#xFF0C;&#x901A;&#x8FC7;&#x6DFB;&#x52A0;&#x53C2;&#x6570;&#xFF0C;&#x53EF;&#x4EE5;&#x8C03;&#x7528;gzip&#x6216;&#x8005;bzip2&#x8FDB;&#x884C;&#x538B;&#x7F29;&#x89E3;&#x538B;&#x64CD;&#x4F5C;&#x3002;</p>
<ul>
<li><p>tar -z: &#x4F7F;&#x7528; gzip&#x65B9;&#x5F0F;&#x6253;&#x5305;&#x5E76;&#x538B;&#x7F29;&#x6587;&#x4EF6;&#xFF0C;&#x540E;&#x7F00;&#x540D;&#x4E3A; .tar.gz,&#x53EF;&#x4EE5;&#x7B80;&#x5199;&#x4E3A; .tgz</p>
</li>
<li><p>tar -j: &#x4F7F;&#x7528; bzip2 &#x65B9;&#x5F0F;&#x6253;&#x5305;&#x5E76;&#x538B;&#x7F29;&#x6587;&#x4EF6;&#xFF0C;&#x540E;&#x7F00;&#x540D;&#x4E3A; .tar.bzip2,&#x53EF;&#x4EE5;&#x7B80;&#x5199;&#x4E3A;   .tbz2   &#x6216;   .tbz</p>
</li>
</ul>
</li>
</ul>

                    
                    </section>
                
                
                </div>
            </div>
        </div>

        
        <a href="./chapter09.html" class="navigation navigation-prev " aria-label="Previous page: 权限管理"><i class="fa fa-angle-left"></i></a>
        
        
        <a href="./chapter11.html" class="navigation navigation-next " aria-label="Next page: 服务监听"><i class="fa fa-angle-right"></i></a>
        
    </div>
</div>

        
<script src="gitbook/app.js"></script>

    
    <script src="gitbook/plugins/gitbook-plugin-splitter/splitter.js"></script>
    

    
    <script src="gitbook/plugins/gitbook-plugin-copy-code-button/toggle.js"></script>
    

    
    <script src="gitbook/plugins/gitbook-plugin-toggle-chapters/toggle.js"></script>
    

    
    <script src="gitbook/plugins/gitbook-plugin-fontsettings/buttons.js"></script>
    

<script>
require(["gitbook"], function(gitbook) {
    var config = {"prism":{},"splitter":{},"copy-code-button":{},"toggle-chapters":{},"highlight":{},"fontsettings":{"theme":"white","family":"sans","size":2}};
    gitbook.start(config);
});
</script>

        <!-- body:end -->
<!-- body:end -->
    </body>
    <!-- End of book Linux -->
<!-- End of book Linux -->
</html>
